package com.iddactylogram.server.transfer.handler;

import com.iddactylogram.common.enumerate.CmdEnums;
import com.iddactylogram.common.core.SeqIdProvider;

import java.nio.charset.StandardCharsets;

public class IdGenHandle implements CmdHandler {

    private final SeqIdProvider seqIdProvider = new SeqIdProvider();

    @Override
    public byte[] handle(CmdEnums cmd, String message) {
        long id = seqIdProvider.genId(message);
        return (id + "").getBytes(StandardCharsets.UTF_8);
    }
}
